import requests


def download_video(url, file_path):
    response = requests.get(url, stream=True)
    if response.status_code == 200:
        with open(file_path, 'wb') as file:
            for chunk in response.iter_content(chunk_size=1024):
                file.write(chunk)
        print("视频下载完成")
    else:
        print("视频下载失败")


# 视频URL
video_url = "https://video.pearvideo.com/mp4/short/20170925/cont-1163939-10930726-hd.mp4"
# 保存的文件路径
file_path = "video.mp4"

# 下载视频
download_video(video_url, file_path)
